<?php
$username=$_POST['username'];
$content=$_POST['content'];
$link=mysqli_connect("localhost","root","root","2113");
$sql="INSERT INTO message(username,content,pid) VALUES ('$username','$content',0)";
$res=mysqli_query($link,$sql);
$arr=[];
if(mysqli_affected_rows($link)){
    $arr['status']=1;
    $arr['info']="添加成功";
}else{
    $arr['status']=0;
    $arr['info']="添加失败";
}
echo json_encode($arr);

?>